let id;
window.onload = function () {
    id = getQuery("id");
}

async function add() {
    let user;
    await axios.get("/user/getUser").then(resp => {
        user = resp.data;
    });

    axios.get("/theme/add", {
        params:{
            name: $("name").value,
            content: $("content").value,
            userId:user.id,
            channelId:id
        }
    }).then(resp => {
        let info = resp.data;
        if (info == "ok") {
            location.href = "/channel.html?id=" + id;
        }
    });
}


function goChannel() {
    location.href = "/channel.html?id=" + id;
}